[code Example] Control Does Not Switch While New Window Pops Up

[code Example] Control Does Not Switch While New Window Pops Up